package com.lbssoft.gpsbd.dao;

import com.lbssoft.gpsbd.model.StatisticsStop;
import org.apache.ibatis.annotations.*;

import java.util.List;


@Mapper
public interface StatisticsStopMapper {

	/**
	 *  写入停留统计
     */
	@Insert("INSERT INTO lbs_statistics_stop (deviceId, latitude, longitude, startTime, endTime, stopTime, address) VALUE(#{deviceId},#{latitude},#{longitude},#{startTime}, #{endTime}, #{stopTime}, #{address})")
	void add(StatisticsStop stop);

	/**
	 * 获取车辆停留记录
	 * @param deviceId
	 * @return
     */
	@Select("SELECT * FROM lbs_statistics_stop where  deviceId = #{deviceId} ORDER BY id desc")
	List<StatisticsStop> list(@Param("deviceId") long deviceId);

}
